From 727650a8fe1b233797a0da12fa40ffcf639a3886 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Tue, 11 Sep 2007 15:12:39 -0600 Subject: [PATCH] [IA64] tak emulation, minor 4k-page correction Signed-off-by: Juergen Gross juergen.gross@fujitsu-siemens.com --- xen/arch/ia64/xen/mm.c | 2 +- xen/arch/ia64/xen/vcpu.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/xen/arch/ia64/xen/mm.c b/xen/arch/ia64/xen/mm.c index f5a4123a49..cccc9329a1 100644 --- a/xen/arch/ia64/xen/mm.c +++ b/xen/arch/ia64/xen/mm.c @@ -527,7 +527,7 @@ u64 translate_domain_pte(u64 pteval, u64 address, u64 itir__, u64* itir, pteval2 = lookup_domain_mpa(d, mpaddr, entry); if (ps < PAGE_SHIFT) - pteval2 |= address & (PAGE_SIZE - 1) & ~((1L << ps) - 1); + pteval2 |= mpaddr & (PAGE_SIZE - 1) & ~((1L << ps) - 1); /* Check access rights. */ arflags = pteval & _PAGE_AR_MASK; diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c index 560660d44c..ea7a922dd6 100644 --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -1817,10 +1817,16 @@ IA64FAULT vcpu_tpa(VCPU * vcpu, u64 vadr, u64 * padr) IA64FAULT vcpu_tak(VCPU * vcpu, u64 vadr, u64 * key) { - printk("vcpu_tak: tak instruction unsupported\n"); - return IA64_ILLOP_FAULT; - // HACK ALERT: tak does a thash for now - //return vcpu_thash(vcpu,vadr,key); + u64 pteval, itir, mask, iha; + IA64FAULT fault; + + fault = vcpu_translate(vcpu, vadr, TRUE, &pteval, &itir, &iha); + if (fault == IA64_NO_FAULT || fault == IA64_USE_TLB) + *key = itir & IA64_ITIR_KEY_MASK; + else + *key = 1; + + return IA64_NO_FAULT; } /************************************************************************** -- 2.30.2